/**
  ******************************************************************************
  * @author     Chris
  * @since      2024/6/16 18:30
  *
  * @file       pd_timer_ch.c
  * @brief      timer channel and gpio peripheral driver.
  *
  * @note       This file contains the driver for the timer channel and gpio.
  *
  * @warning    None.
  ******************************************************************************
  * Change Logs:
  *   Date          Author       Notes
  *   2024/6/16     Chris        the first version
  *
  ******************************************************************************
  */


#include "pd_timer_ch.h"

static TimerCh *build(GPIO **gpios, uint8_t gpioSize, uint32_t *channels, uint8_t chSize) {
    TimerCh *timerCh = malloc(sizeof(TimerCh));

    Driver_add(timerCh, GEN_PERM);

    timerCh->gpios    = gpios;
    timerCh->gpioSize = gpioSize;
    timerCh->channels = channels;
    timerCh->chSize   = chSize;

    return timerCh;
}

const struct TimerChClass TimerChBuilder = {.build = &build};